package com.loocup.demo1;

import com.loocup.demo1.config.MyConfig;
import com.loocup.demo1.bean.HelloSpring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppByJava {

    public static void main(String[] args) {
        ApplicationContext ac = new AnnotationConfigApplicationContext(MyConfig.class);
        HelloSpring helloSpring = (HelloSpring) ac.getBean("helloSpring");
        System.out.println(helloSpring.getName());
        System.out.println(helloSpring.getAge());
    }
}
